<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
    let a = 123;
    function edit() {
      a = 456
    }  
    edit();
    console.log(a);//456

    let b = 123;
    function update(b) {
      b = 456
      return b
    }
    b =  update(111)
    // update(111)
    console.log(b);//123
    </script>
</head>

<body>

</body>

</html>